home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
mint
/
lib
/
mntlib44.zoo
/
mntlib
/
chown.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-03-01
|
618b
|
35 lines
/* chown -- change the owner and group of a file */
/* written by Eric R. Smith and placed in the public domain */
/* this is faked if MiNT is not running */
#include <types.h>
#include <stat.h>
#include <osbind.h>
#include <mintbind.h>
#include <limits.h>
#include <errno.h>
#include <unistd.h>
#include "lib.h"
extern int __mint;
int
chown(_name, uid, gid)
const char *_name;
int uid, gid;
{
int r;
char name[PATH_MAX];
if (__mint >= 9) {
(void)_unx2dos(_name, name);
r = (int)Fchown(name, uid, gid);
if (r && (r != -EINVAL)) {
errno = -r;
return -1;
}
return 0;
}
return 0;
}